package com.example.lll.weather_lll_20.View.activity;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

import com.example.lll.weather_lll_20.R;

public class MainActivity extends AppCompatActivity {
    public Button button;
    public TextView tv;
    public int num = 0;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Toast.makeText(this,"clicked!!!!!",Toast.LENGTH_LONG).show();

        button = findViewById(R.id.btn);
        tv = findViewById(R.id.tv);

        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Toast.makeText(MainActivity.this,"Button clicked",Toast.LENGTH_LONG).show();
                num +=1;
                tv.setText("clicked:" + num);
            }
        });
    }
}
